﻿///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct  4 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "tracConfig_GUI.h"

///////////////////////////////////////////////////////////////////////////

MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	m_statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, ID_DEFAULT );
	m_menubar = new wxMenuBar( 0 );
	m_fileMenu = new wxMenu();
	wxMenuItem* fileExit;
	fileExit = new wxMenuItem( m_fileMenu, ID_FILE_EXIT, wxString( wxT("E&xit") ) + wxT('\t') + wxT("Alt+F4"), wxT("Exit the application"), wxITEM_NORMAL );
	m_fileMenu->Append( fileExit );
	
	m_menubar->Append( m_fileMenu, wxT("&File") ); 
	
	m_helpMenu = new wxMenu();
	wxMenuItem* helpAbout;
	helpAbout = new wxMenuItem( m_helpMenu, ID_HELP_ABOUT, wxString( wxT("&About") ) + wxT('\t') + wxT("F1"), wxT("Show info about this application"), wxITEM_NORMAL );
	m_helpMenu->Append( helpAbout );
	
	m_menubar->Append( m_helpMenu, wxT("&Help") ); 
	
	this->SetMenuBar( m_menubar );
	
	
	this->Centre( wxBOTH );
	
	// Connect Events
	this->Connect( fileExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnQuit ) );
	this->Connect( helpAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnAbout ) );
}

MainFrame::~MainFrame()
{
	// Disconnect Events
	this->Disconnect( ID_FILE_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnQuit ) );
	this->Disconnect( ID_HELP_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnAbout ) );
	
}

MainPanel::MainPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	m_panel2 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer7;
	bSizer7 = new wxBoxSizer( wxHORIZONTAL );
	
	wxBoxSizer* bSizer14;
	bSizer14 = new wxBoxSizer( wxVERTICAL );
	
	m_staticText5 = new wxStaticText( m_panel2, wxID_ANY, wxT("Tack项目文件夹"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText5->Wrap( -1 );
	bSizer14->Add( m_staticText5, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	m_staticText7 = new wxStaticText( m_panel2, wxID_ANY, wxT("Apache工作路径"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText7->Wrap( -1 );
	bSizer14->Add( m_staticText7, 1, wxALL|wxEXPAND, 5 );
	
	m_staticText6 = new wxStaticText( m_panel2, wxID_ANY, wxT("密码文件路径"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText6->Wrap( -1 );
	bSizer14->Add( m_staticText6, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	m_staticText8 = new wxStaticText( m_panel2, wxID_ANY, wxT("版本库路径"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText8->Wrap( -1 );
	bSizer14->Add( m_staticText8, 1, wxALL|wxEXPAND, 5 );
	
	bSizer7->Add( bSizer14, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* bSizer15;
	bSizer15 = new wxBoxSizer( wxVERTICAL );
	
	m_dirPicker_Trac = new wxDirPickerCtrl( m_panel2, wxID_ANY, wxEmptyString, wxT("选择项目文件夹"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE );
	bSizer15->Add( m_dirPicker_Trac, 1, wxALL|wxEXPAND, 5 );
	
	m_dirPicker_Apache = new wxDirPickerCtrl( m_panel2, wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE );
	bSizer15->Add( m_dirPicker_Apache, 1, wxALL|wxEXPAND, 5 );
	
	m_filePicker_Pass = new wxFilePickerCtrl( m_panel2, wxID_ANY, wxEmptyString, wxT("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE );
	bSizer15->Add( m_filePicker_Pass, 1, wxALL|wxEXPAND, 5 );
	
	m_dirPicker_SVN = new wxDirPickerCtrl( m_panel2, wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE );
	bSizer15->Add( m_dirPicker_SVN, 1, wxALL|wxEXPAND, 5 );
	
	bSizer7->Add( bSizer15, 1, wxEXPAND, 5 );
	
	m_panel2->SetSizer( bSizer7 );
	m_panel2->Layout();
	bSizer7->Fit( m_panel2 );
	mainSizer->Add( m_panel2, 0, wxEXPAND | wxALL, 5 );
	
	m_panel3 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer6;
	bSizer6 = new wxBoxSizer( wxHORIZONTAL );
	
	m_panel4 = new wxPanel( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer10;
	bSizer10 = new wxBoxSizer( wxHORIZONTAL );
	
	wxBoxSizer* bSizer12;
	bSizer12 = new wxBoxSizer( wxVERTICAL );
	
	m_button_CreateTrac = new wxButton( m_panel4, wxID_ANY, wxT("创建 Trac"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer12->Add( m_button_CreateTrac, 1, wxALL|wxEXPAND, 5 );
	
	m_button_Start = new wxButton( m_panel4, wxID_ANY, wxT("关联 Apache Trac"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer12->Add( m_button_Start, 1, wxALL|wxEXPAND, 5 );
	
	m_button_Init = new wxButton( m_panel4, wxID_ANY, wxT("初始化Trac"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer12->Add( m_button_Init, 1, wxALL|wxEXPAND, 5 );
	
	m_button_bitten_rpc = new wxButton( m_panel4, wxID_ANY, wxT("增加 Bitten, RPC支持"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer12->Add( m_button_bitten_rpc, 1, wxALL|wxEXPAND, 5 );
	
	bSizer10->Add( bSizer12, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer121;
	bSizer121 = new wxBoxSizer( wxVERTICAL );
	
	m_staticText9 = new wxStaticText( m_panel4, wxID_ANY, wxT("日志记录信息"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText9->Wrap( -1 );
	bSizer121->Add( m_staticText9, 0, wxALL, 5 );
	
	m_list_Log = new wxListBox( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); 
	bSizer121->Add( m_list_Log, 1, wxALL|wxEXPAND, 5 );
	
	wxBoxSizer* bSizer13;
	bSizer13 = new wxBoxSizer( wxHORIZONTAL );
	
	m_button_Upgrade = new wxButton( m_panel4, wxID_ANY, wxT("升级 Trac"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer13->Add( m_button_Upgrade, 1, wxALL|wxEXPAND, 5 );
	
	m_button_UpWiki = new wxButton( m_panel4, wxID_ANY, wxT("升级Wiki"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer13->Add( m_button_UpWiki, 1, wxALL|wxEXPAND, 5 );
	
	m_button_svn = new wxButton( m_panel4, wxID_ANY, wxT("重同步版本库"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer13->Add( m_button_svn, 1, wxALL|wxEXPAND, 5 );
	
	bSizer121->Add( bSizer13, 0, wxEXPAND, 5 );
	
	bSizer10->Add( bSizer121, 1, wxEXPAND, 5 );
	
	m_panel4->SetSizer( bSizer10 );
	m_panel4->Layout();
	bSizer10->Fit( m_panel4 );
	bSizer6->Add( m_panel4, 1, wxEXPAND | wxALL, 5 );
	
	m_panel1 = new wxPanel( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer5;
	bSizer5 = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bSizer141;
	bSizer141 = new wxBoxSizer( wxVERTICAL );
	
	m_staticText4 = new wxStaticText( m_panel1, wxID_ANY, wxT("用户列表"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText4->Wrap( -1 );
	bSizer141->Add( m_staticText4, 0, wxALL, 5 );
	
	wxArrayString m_checkList_UserChoices;
	m_checkList_User = new wxCheckListBox( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_checkList_UserChoices, 0 );
	bSizer141->Add( m_checkList_User, 1, wxALL|wxEXPAND, 5 );
	
	bSizer5->Add( bSizer141, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer151;
	bSizer151 = new wxBoxSizer( wxVERTICAL );
	
	m_button_AddAdmin = new wxButton( m_panel1, wxID_ANY, wxT("添加指定用户\n为管理员"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer151->Add( m_button_AddAdmin, 0, wxALL|wxEXPAND, 5 );
	
	m_button_list = new wxButton( m_panel1, wxID_ANY, wxT("显示所有用户列表"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer151->Add( m_button_list, 0, wxALL|wxEXPAND, 5 );
	
	bSizer5->Add( bSizer151, 0, wxEXPAND, 5 );
	
	m_panel1->SetSizer( bSizer5 );
	m_panel1->Layout();
	bSizer5->Fit( m_panel1 );
	bSizer6->Add( m_panel1, 0, wxEXPAND | wxALL, 5 );
	
	m_panel3->SetSizer( bSizer6 );
	m_panel3->Layout();
	bSizer6->Fit( m_panel3 );
	mainSizer->Add( m_panel3, 1, wxEXPAND | wxALL, 5 );
	
	this->SetSizer( mainSizer );
	this->Layout();
	
	// Connect Events
	m_dirPicker_Trac->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainPanel::OnTracDirChange ), NULL, this );
	m_dirPicker_Apache->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainPanel::OnApacheDirChange ), NULL, this );
	m_filePicker_Pass->Connect( wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEventHandler( MainPanel::OnPassFileChange ), NULL, this );
	m_dirPicker_SVN->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainPanel::OnSvnDirChange ), NULL, this );
	m_button_CreateTrac->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnTracCreate ), NULL, this );
	m_button_Start->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnButStart ), NULL, this );
	m_button_Init->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnTracInit ), NULL, this );
	m_button_bitten_rpc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnButtonBittenRPC ), NULL, this );
	m_button_Upgrade->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnTracUpgrade ), NULL, this );
	m_button_UpWiki->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnWikiUpgrade ), NULL, this );
	m_button_svn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnSVNResync ), NULL, this );
	m_button_AddAdmin->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnAddAdmin ), NULL, this );
	m_button_list->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnListPermission ), NULL, this );
}

MainPanel::~MainPanel()
{
	// Disconnect Events
	m_dirPicker_Trac->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainPanel::OnTracDirChange ), NULL, this );
	m_dirPicker_Apache->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainPanel::OnApacheDirChange ), NULL, this );
	m_filePicker_Pass->Disconnect( wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEventHandler( MainPanel::OnPassFileChange ), NULL, this );
	m_dirPicker_SVN->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainPanel::OnSvnDirChange ), NULL, this );
	m_button_CreateTrac->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnTracCreate ), NULL, this );
	m_button_Start->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnButStart ), NULL, this );
	m_button_Init->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnTracInit ), NULL, this );
	m_button_bitten_rpc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnButtonBittenRPC ), NULL, this );
	m_button_Upgrade->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnTracUpgrade ), NULL, this );
	m_button_UpWiki->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnWikiUpgrade ), NULL, this );
	m_button_svn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnSVNResync ), NULL, this );
	m_button_AddAdmin->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnAddAdmin ), NULL, this );
	m_button_list->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnListPermission ), NULL, this );
	
}

AboutDlg::AboutDlg( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	wxStaticBoxSizer* infoSizer;
	infoSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL );
	
	wxBoxSizer* bSizer10;
	bSizer10 = new wxBoxSizer( wxHORIZONTAL );
	
	m_icon = new wxStaticBitmap( this, ID_ABOUT_ICON, wxICON( amain ), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer10->Add( m_icon, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* textSizer;
	textSizer = new wxBoxSizer( wxVERTICAL );
	
	m_staticAppName = new wxStaticText( this, ID_ABOUT_APPNAME, wxT("tracPack"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticAppName->Wrap( -1 );
	m_staticAppName->SetFont( wxFont( 10, 70, 90, 92, false, wxT("Arial") ) );
	
	textSizer->Add( m_staticAppName, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
	
	m_staticVersion = new wxStaticText( this, ID_ABOUT_VERSION, wxT("Version "), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticVersion->Wrap( -1 );
	textSizer->Add( m_staticVersion, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	bSizer10->Add( textSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	infoSizer->Add( bSizer10, 1, 0, 5 );
	
	m_staticline1 = new wxStaticLine( this, ID_DEFAULT, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	infoSizer->Add( m_staticline1, 0, wxALL|wxEXPAND, 5 );
	
	m_staticCopyright = new wxStaticText( this, ID_ABOUT_COPYRIGHT, wxT("Copyright © 2006, lava_sdb "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
	m_staticCopyright->Wrap( -1 );
	infoSizer->Add( m_staticCopyright, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	mainSizer->Add( infoSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	m_aboutDialogButtonSizer = new wxStdDialogButtonSizer();
	m_aboutDialogButtonSizerOK = new wxButton( this, wxID_OK );
	m_aboutDialogButtonSizer->AddButton( m_aboutDialogButtonSizerOK );
	m_aboutDialogButtonSizer->Realize();
	mainSizer->Add( m_aboutDialogButtonSizer, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
	
	this->SetSizer( mainSizer );
	this->Layout();
	
	this->Centre( wxBOTH );
}

AboutDlg::~AboutDlg()
{
}
